#include<stdio.h>
int main(){
	int n = 0;
	int i = 0;
	int min = 10;
	int max = 0;
	int num = 0;
	float res = 0;
	 
	scanf("%d",&n);
	
	for(i=0;i<n;i++){
//		scanf("%d",&num);
		res += num;
			if(num < min){
				min = num;
			}
			else if(num > max){
				max = num;
			}
		}
//		printf("res=%f\n",res) ;
//		printf("max=%d\n",max);
//		printf("min=%d\n",min); 
		double average = (res-min-max)/(n-2);
		printf("%.2f",average);
	
	return 0; 
	
} 
